package org.cyx.javasx.view;

import java.awt.Component;

public class View implements IView {
    protected String id;

    protected Component component;

    public View(Component component) {
        this.component = component;
    }

    @Override
    public Object findViewById(String id) {
        if (this.id != null && this.id.equals(id)) {
            return this.getOComponent();
        }
        return null;
    }

    @Override
    public String getId() {
        return this.id;
    }

    @Override
    public void setId(String id) {
        this.id = id;
    }

    @Override
    public Component getOComponent() {
        return this.component;
    }
}